<?php 
/**
* Generate URLs. Use this class whenever you need a URL to the Engine! It takes care of parameters.
*<p>Usage is simple: create an URL object passing your set of GET parameters (you canoptionally change your
*<i>base</i> which is the main.php or index.php or whatever).</p>
*@package Core
*@author Willy Gardiol <willy@gardiol.org>
*@version 1.0
*/
class Url
{
	private $params = array();
	private $base = false;
	/**
	* Create a new URL to the engine.
	*@param array $params Named array with GET parameters with values to set
	*@param string $base optional elternative to set as base PHP page
	*/
	public function __construct( $params = array(), $base = false )
	{
		$this->base = $base ? $base : Core::GetUri("base");
		$this->params = $params;
	}
	/**
	* Generate the URL.
	*@return string The URL
	*/
	public function __tostring()
	{
		$gets = Core::GenerateGetString( $this->params );
		return Core::GetUri("path").$this->base."?".$gets;
	}
}
?>